:root {
    /* 颜色：基础 */
    --apple-primary: #0071e3;
    --apple-primary-dark: #0077ed;
    --apple-primary-light: #147ce5;
    --apple-secondary: #6e6e73;
    --apple-success: #34c759;
    --apple-warning: #ff9500;
    --apple-danger: #ff3b30;
    --apple-info: #5ac8fa;

    /* 颜色：文本 */
    --apple-text-primary-light: #1d1d1f;
    --apple-text-secondary-light: #6e6e73;
    --apple-text-tertiary-light: #86868b;
    --apple-text-disabled-light: #aaaaaa;

    --apple-text-primary-dark: #f5f5f7;
    --apple-text-secondary-dark: #a1a1a6;
    --apple-text-tertiary-dark: #86868b;
    --apple-text-disabled-dark: #555555;

    /* 颜色：背景 */
    --apple-background-light: #f5f5f7;
    --apple-background-dark: #1d1d1f;

    /* 颜色：卡片 */
    --apple-card-background-light: #ffffff;
    --apple-card-background-dark: #2c2c2e;

    /* 颜色：输入框 */
    --apple-input-background-light: #f5f5f7;
    --apple-input-background-dark: #2c2c2e;

    /* 颜色：边框 */
    --apple-border-light: rgba(0, 0, 0, 0.1);
    --apple-border-dark: rgba(255, 255, 255, 0.1);

    /* 阴影 */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.04), 0 3px 6px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.05), 0 10px 10px rgba(0, 0, 0, 0.04);

    /* 暗模式阴影 */
    --shadow-xs-dark: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-sm-dark: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.6);
    --shadow-md-dark: 0 4px 6px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-lg-dark: 0 10px 15px rgba(0, 0, 0, 0.3), 0 3px 6px rgba(0, 0, 0, 0.5);
    --shadow-xl-dark: 0 20px 25px rgba(0, 0, 0, 0.3), 0 10px 10px rgba(0, 0, 0, 0.4);

    /* 圆角 */
    --border-radius-sm: 6px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-2xl: 20px;
    --border-radius-full: 9999px;

    /* 常用组件圆角 */
    --button-border-radius: var(--border-radius-full);
    --card-border-radius: var(--border-radius-lg);
    --input-border-radius: var(--border-radius-sm);
    --modal-border-radius: var(--border-radius-2xl);

    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;

    /* 字体大小 */
    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 32px;
    --font-size-4xl: 40px;

    /* 字体粗细 */
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* 行高 */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* 动画速度 */
    --animation-speed-fast: 150ms;
    --animation-speed-medium: 300ms;
    --animation-speed-slow: 500ms;

    /* 过渡曲线 */
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-apple: cubic-bezier(0.33, 1, 0.68, 1);

    /* Z-Index层级 */
    --z-index-dropdown: 1000;
    --z-index-sticky: 1100;
    --z-index-fixed: 1200;
    --z-index-modal-backdrop: 1300;
    --z-index-modal: 1400;
    --z-index-popover: 1500;
    --z-index-tooltip: 1600;
}

/* 媒体查询：深色模式 */
@media (prefers-color-scheme: dark) {
    :root {
        /* 在深色模式下自动切换颜色变量 */
        --apple-text-default: var(--apple-text-primary-dark);
        --apple-text-secondary: var(--apple-text-secondary-dark);
        --apple-text-tertiary: var(--apple-text-tertiary-dark);
        --apple-text-disabled: var(--apple-text-disabled-dark);

        --apple-background: var(--apple-background-dark);
        --apple-card-background: var(--apple-card-background-dark);
        --apple-input-background: var(--apple-input-background-dark);
        --apple-border: var(--apple-border-dark);
    }
}

/* 媒体查询：浅色模式 */
@media (prefers-color-scheme: light) {
    :root {
        /* 在浅色模式下自动切换颜色变量 */
        --apple-text-default: var(--apple-text-primary-light);
        --apple-text-secondary: var(--apple-text-secondary-light);
        --apple-text-tertiary: var(--apple-text-tertiary-light);
        --apple-text-disabled: var(--apple-text-disabled-light);

        --apple-background: var(--apple-background-light);
        --apple-card-background: var(--apple-card-background-light);
        --apple-input-background: var(--apple-input-background-light);
        --apple-border: var(--apple-border-light);
    }
}

/* 动画关键帧 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }

    100% {
        background-position: 468px 0;
    }
}

/* 通用动画类 */
.fade-in {
    animation: fadeIn var(--animation-speed-medium) cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

.scale-in {
    animation: scaleIn var(--animation-speed-medium) cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

.slide-in-right {
    animation: slideInFromRight var(--animation-speed-medium) cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

.slide-in-left {
    animation: slideInFromLeft var(--animation-speed-medium) cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

/* 过渡动画 */
.fade-transition-enter-active,
.fade-transition-leave-active {
    transition: opacity var(--animation-speed-medium) cubic-bezier(0.33, 1, 0.68, 1);
}

.fade-transition-enter-from,
.fade-transition-leave-to {
    opacity: 0;
}

.scale-transition-enter-active,
.scale-transition-leave-active {
    transition: opacity var(--animation-speed-medium) cubic-bezier(0.33, 1, 0.68, 1),
        transform var(--animation-speed-medium) cubic-bezier(0.33, 1, 0.68, 1);
}

.scale-transition-enter-from,
.scale-transition-leave-to {
    opacity: 0;
    transform: scale(0.95);
}

.slide-transition-enter-active,
.slide-transition-leave-active {
    transition: opacity var(--animation-speed-medium) cubic-bezier(0.33, 1, 0.68, 1),
        transform var(--animation-speed-medium) cubic-bezier(0.33, 1, 0.68, 1);
}

.slide-transition-enter-from,
.slide-transition-leave-to {
    opacity: 0;
    transform: translateY(10px);
}